home *** CD-ROM | disk | FTP | other *** search
- package java.io;
-
- class Console$LineReader extends Reader {
- // $FF: renamed from: in java.io.Reader
- private Reader field_0;
- // $FF: renamed from: cb char[]
- private char[] field_1;
- private int nChars;
- private int nextChar;
- boolean leftoverLF;
- // $FF: synthetic field
- final Console this$0;
-
- Console$LineReader(Console var1, Reader var2) {
- this.this$0 = var1;
- this.field_0 = var2;
- this.field_1 = new char[1024];
- this.nextChar = this.nChars = 0;
- this.leftoverLF = false;
- }
-
- public void close() {
- }
-
- public boolean ready() throws IOException {
- return this.field_0.ready();
- }
-
- public int read(char[] var1, int var2, int var3) throws IOException {
- int var4 = var2;
- int var5 = var2 + var3;
- if (var2 >= 0 && var2 <= var1.length && var3 >= 0 && var5 >= 0 && var5 <= var1.length) {
- synchronized(Console.access$000(this.this$0)) {
- boolean var7 = false;
- char var8 = '\u0000';
-
- do {
- if (this.nextChar >= this.nChars) {
- int var9 = 0;
-
- do {
- var9 = this.field_0.read(this.field_1, 0, this.field_1.length);
- } while(var9 == 0);
-
- if (var9 <= 0) {
- if (var4 - var2 == 0) {
- return -1;
- }
-
- return var4 - var2;
- }
-
- this.nChars = var9;
- this.nextChar = 0;
- if (var9 < this.field_1.length && this.field_1[var9 - 1] != '\n' && this.field_1[var9 - 1] != '\r') {
- var7 = true;
- }
- }
-
- if (this.leftoverLF && var1 == Console.access$100(this.this$0) && this.field_1[this.nextChar] == '\n') {
- ++this.nextChar;
- }
-
- this.leftoverLF = false;
-
- while(this.nextChar < this.nChars) {
- var8 = var1[var4++] = this.field_1[this.nextChar];
- this.field_1[this.nextChar++] = 0;
- if (var8 == '\n') {
- return var4 - var2;
- }
-
- if (var8 == '\r') {
- if (var4 == var5) {
- if (var1 != Console.access$100(this.this$0)) {
- this.leftoverLF = true;
- return var4 - var2;
- }
-
- var1 = Console.access$200(this.this$0);
- var5 = var1.length;
- }
-
- if (this.nextChar == this.nChars && this.field_0.ready()) {
- this.nChars = this.field_0.read(this.field_1, 0, this.field_1.length);
- this.nextChar = 0;
- }
-
- if (this.nextChar < this.nChars && this.field_1[this.nextChar] == '\n') {
- var1[var4++] = '\n';
- ++this.nextChar;
- }
-
- return var4 - var2;
- }
-
- if (var4 == var5) {
- if (var1 != Console.access$100(this.this$0)) {
- return var4 - var2;
- }
-
- var1 = Console.access$200(this.this$0);
- var5 = var1.length;
- }
- }
- } while(!var7);
-
- return var4 - var2;
- }
- } else {
- throw new IndexOutOfBoundsException();
- }
- }
- }
-